package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.OrderPurchaseTermsMapper;
import com.ly.heart.service.IOrderPurchaseTermsService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.OrderPurchaseTermsEntity;

import javax.annotation.Resource;

/**
 * 采购订单与采购条款关联Service业务层处理
 *
 * @author cxl
 * @date 2024-06-23
 */
@Service
public class OrderPurchaseTermsServiceImpl extends ServiceImpl<OrderPurchaseTermsMapper,OrderPurchaseTermsEntity> implements IOrderPurchaseTermsService {

    @Resource
    private OrderPurchaseTermsMapper orderPurchaseTermsMapper;

    /**
     * 查询采购订单与采购条款关联
     *
     * @param id 采购订单与采购条款关联ID
     * @return 采购订单与采购条款关联
     */
    @Override
    public OrderPurchaseTermsEntity selectOrderPurchaseTermsEntityById(String id)
    {
        return orderPurchaseTermsMapper.selectOrderPurchaseTermsEntityById(id);
    }

    /**
     * 查询采购订单与采购条款关联列表
     *
     * @param orderPurchaseTermsEntity 采购订单与采购条款关联
     * @return 采购订单与采购条款关联
     */
    @Override
    public List<OrderPurchaseTermsEntity> selectOrderPurchaseTermsEntityList(OrderPurchaseTermsEntity orderPurchaseTermsEntity)
    {
        return orderPurchaseTermsMapper.selectOrderPurchaseTermsEntityList(orderPurchaseTermsEntity);
    }

    /**
     * 新增采购订单与采购条款关联
     *
     * @param orderPurchaseTermsEntity 采购订单与采购条款关联
     * @return 结果
     */
    @Override
    public int insertOrderPurchaseTermsEntity(OrderPurchaseTermsEntity orderPurchaseTermsEntity)
    {
        orderPurchaseTermsEntity.setCreateTime(DateUtils.getNowDate());
        return orderPurchaseTermsMapper.insertOrderPurchaseTermsEntity(orderPurchaseTermsEntity);
    }

    /**
     * 修改采购订单与采购条款关联
     *
     * @param orderPurchaseTermsEntity 采购订单与采购条款关联
     * @return 结果
     */
    @Override
    public int updateOrderPurchaseTermsEntity(OrderPurchaseTermsEntity orderPurchaseTermsEntity)
    {
        return orderPurchaseTermsMapper.updateOrderPurchaseTermsEntity(orderPurchaseTermsEntity);
    }

    /**
     * 批量删除采购订单与采购条款关联
     *
     * @param ids 需要删除的采购订单与采购条款关联ID
     * @return 结果
     */
    @Override
    public int deleteOrderPurchaseTermsEntityByIds(String[] ids)
    {
        return orderPurchaseTermsMapper.deleteOrderPurchaseTermsEntityByIds(ids);
    }

    /**
     * 删除采购订单与采购条款关联信息
     *
     * @param id 采购订单与采购条款关联ID
     * @return 结果
     */
    @Override
    public int deleteOrderPurchaseTermsEntityById(String id)
    {
        return orderPurchaseTermsMapper.deleteOrderPurchaseTermsEntityById(id);
    }
}
